﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Ylh.Enums
{
    public class GlobalConfig : ConfigurationSection
    {
        /// <summary>
        /// 获取Web.config中的配置信息
        /// </summary>
        private static SysConfigSection SysConfig
        {
            get
            {
                return ConfigurationManager.GetSection("YLH") as SysConfigSection;   
            }
        }

        /// <summary>
        /// 获取配置文件中的连接字符串
        /// </summary>
        public static String ConnectionStr
        {
            get
            {
                return SysConfig.ConnectionString;
            }
        }

        /// <summary>
        /// 获取配置文件中的数据库类型
        /// </summary>
        public static String DbType
        {
            get
            {
                return SysConfig.DataDbType;
            }
        }


        /// <summary>
        /// 获取配置文件中的数据库版本
        /// </summary>
        public static String DbVersion
        {
            get
            {
                return SysConfig.DbVersion;
            }
        }

        /// <summary>
        /// 获取Web.config中的配置信息
        /// </summary>
        private static SysConfigSectionRead SysConfigRead
        {
            get
            {
                return ConfigurationManager.GetSection("YLHRead") as SysConfigSectionRead;
            }
        }


        /// <summary>
        /// 获取配置文件中的连接字符串
        /// </summary>
        public static String ReadConnectionStr
        {
            get
            {
                return SysConfigRead.ReadConnectionString;
            }
        }

        /// <summary>
        /// 获取配置文件中的数据库类型
        /// </summary>
        public static String ReadDbType
        {
            get
            {
                return SysConfigRead.ReadDataDbType;
            }
        }


        /// <summary>
        /// 获取配置文件中的数据库版本
        /// </summary>
        public static String ReadDbVersion
        {
            get
            {
                return SysConfigRead.ReadDbVersion;
            }
        }




    }
}
